<!DOCTYPE html>












  


<html class="theme-next gemini use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">












<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
    
  
  <link href="//cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.4.1/dist/jquery.fancybox.min.css" rel="stylesheet" type="text/css">




  
  
  
  

  

  

  

  
    

    
  

  

  
    
    
    <link href="//fonts.loli.net/css?family=Damion:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/blog/css/main.css?v=6.6.0" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png?v=6.6.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png?v=6.6.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png?v=6.6.0">


  <link rel="mask-icon" href="/blog/images/logo.svg?v=6.6.0" color="#222">









<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Gemini',
    version: '6.6.0',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":true,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    fastclick: false,
    lazyload: true,
    tabs: true,
    motion: {"enable":true,"async":true,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>


  




  <meta name="description" content="在使用Docker安装Gogs时，一般会把容器的22端口映射到主机的其它端口(比如10022)在以SSH方式clone项目时，URL长这样  ssh://git@git.example.com:10022:username/project.git  但我们想要的是类似于GitHub那样的，这时需要把Gogs的SSH端口设置为22  git@git.example.com:username/proj">
<meta name="keywords" content="Gogs,Git,SSH,Docker">
<meta property="og:type" content="article">
<meta property="og:title" content="Gogs与主机共享22端口">
<meta property="og:url" content="https://raincal.gitee.io/blog/post/gogs-share-22-port/index.html">
<meta property="og:site_name" content="Raincal&#39;s Blog">
<meta property="og:description" content="在使用Docker安装Gogs时，一般会把容器的22端口映射到主机的其它端口(比如10022)在以SSH方式clone项目时，URL长这样  ssh://git@git.example.com:10022:username/project.git  但我们想要的是类似于GitHub那样的，这时需要把Gogs的SSH端口设置为22  git@git.example.com:username/proj">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2018-12-08T07:19:09.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Gogs与主机共享22端口">
<meta name="twitter:description" content="在使用Docker安装Gogs时，一般会把容器的22端口映射到主机的其它端口(比如10022)在以SSH方式clone项目时，URL长这样  ssh://git@git.example.com:10022:username/project.git  但我们想要的是类似于GitHub那样的，这时需要把Gogs的SSH端口设置为22  git@git.example.com:username/proj">



  <link rel="alternate" href="/blog/atom.xml" title="Raincal's Blog" type="application/atom+xml">




  <link rel="canonical" href="https://raincal.gitee.io/blog/post/gogs-share-22-port/">



<script type="text/javascript" id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  <title>Gogs与主机共享22端口 | Raincal's Blog</title>
  




<script async src="https://www.googletagmanager.com/gtag/js?id=UA-89637345-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-89637345-1');
</script>








  <noscript>
  <style type="text/css">
    .use-motion .motion-element,
    .use-motion .brand,
    .use-motion .menu-item,
    .sidebar-inner,
    .use-motion .post-block,
    .use-motion .pagination,
    .use-motion .comments,
    .use-motion .post-header,
    .use-motion .post-body,
    .use-motion .collection-title { opacity: initial; }

    .use-motion .logo,
    .use-motion .site-title,
    .use-motion .site-subtitle {
      opacity: initial;
      top: initial;
    }

    .use-motion {
      .logo-line-before i { left: initial; }
      .logo-line-after i { right: initial; }
    }
  </style>
</noscript>

</head>

<body itemscope="" itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope="" itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Raincal's Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">

    
    
    
      
    

    

    <a href="/blog/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">

    
    
    
      
    

    

    <a href="/blog/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">

    
    
    
      
    

    

    <a href="/blog/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-about">

    
    
    
      
    

    

    <a href="/blog/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i> <br>关于</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-photos">

    
    
    
      
    

    

    <a href="/blog/photos/" rel="section"><i class="menu-item-icon fa fa-fw fa-camera-retro"></i> <br>photos</a>

  </li>

      
      
    </ul>
  

  

  
</nav>



  



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://raincal.gitee.io/blog/blog/post/gogs-share-22-port/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Raincal">
      <meta itemprop="description" content="El Psy Congroo">
      <meta itemprop="image" content="https://cdn-1256167913.image.myqcloud.com/images/avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Raincal's Blog">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">Gogs与主机共享22端口
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">

            
            
            

            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2018-03-10 01:42:14" itemprop="dateCreated datePublished" datetime="2018-03-10T01:42:14+08:00">2018-03-10</time>
            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>在使用Docker安装Gogs时，一般会把容器的22端口映射到主机的其它端口(比如10022)<br>在以SSH方式clone项目时，URL长这样</p>
<blockquote>
<p>ssh:<a href="mailto://git@git.example.com" target="_blank" rel="noopener">//git@git.example.com</a>:10022:username/project.git</p>
</blockquote>
<p>但我们想要的是类似于GitHub那样的，这时需要把Gogs的SSH端口设置为22</p>
<blockquote>
<p><a href="mailto:git@git.example.com" target="_blank" rel="noopener">git@git.example.com</a>:username/project.git</p>
</blockquote>
<a id="more"></a>
<p>下面说一下主要步骤</p>
<h3 id="创建git用户"><a href="#创建git用户" class="headerlink" title="创建git用户"></a>创建git用户</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">[root]$ useradd git</span><br><span class="line">[root]$ id git    <span class="comment"># 获取uid和gid</span></span><br><span class="line">uid=1002(git) gid=1002(git) groups=1002(git)</span><br><span class="line">[root]$ usermod -aG docker git    <span class="comment"># 把git用户加入docker组</span></span><br><span class="line">[root]$ su git</span><br><span class="line">[git]$ mkdir -p ~/gogs/data   <span class="comment"># 在git用户下创建gogs/data文件夹，作为gogs容器主要数据的挂载目录</span></span><br></pre></td></tr></table></figure>
<h3 id="安装Gogs"><a href="#安装Gogs" class="headerlink" title="安装Gogs"></a>安装Gogs</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[git]$ docker run -d --name=gogs -p 10022:22 -p 10080:3000 -v ~/gogs/data:/data -e <span class="string">"PUID=1002"</span> -e <span class="string">"PGID=1002"</span> --restart=always gogs/gogs     <span class="comment"># PUID PGID与上面获取的uid gid保持一致</span></span><br><span class="line">[git]$ ln -s ~/gogs/data/git/.ssh ~/    <span class="comment"># 将gogs的.ssh目录软连接到本地的.ssh</span></span><br></pre></td></tr></table></figure>
<p>现在可以通过服务器外网ip:10080进入安装页面，也可以等反代设置好后通过域名进行访问<br>我用的数据库是Sqlite3，不需要额外配置，如果你选择的是其它数据库，可以参考<a href="https://www.jianshu.com/p/424627516ef6" target="_blank" rel="noopener">这篇文章</a><br>相关配置可以参考<a href="https://gogs.io/docs/advanced/configuration_cheat_sheet" target="_blank" rel="noopener">官方文档</a></p>
<h3 id="生成SSH-key"><a href="#生成SSH-key" class="headerlink" title="生成SSH key"></a>生成SSH key</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">[git]$ ssh-keygen -t rsa -b 4096 -C <span class="string">"git@git.example.com"</span></span><br><span class="line">[git]$ <span class="built_in">cd</span> ~/.ssh</span><br><span class="line">[git]$ cat id_rsa.pub &gt;&gt; authorized_keys</span><br><span class="line">[git]$ chmod 600 authorized_keys</span><br></pre></td></tr></table></figure>
<p>在authorized_keys最前面添加</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaC1y..........YGedddqAN6w== git@git.example.com</span><br></pre></td></tr></table></figure>
<h3 id="Caddy反向代理"><a href="#Caddy反向代理" class="headerlink" title="Caddy反向代理"></a>Caddy反向代理</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root]$ mkdir caddy &amp;&amp; <span class="built_in">cd</span> <span class="variable">$_</span></span><br></pre></td></tr></table></figure>
<p>在caddy目录下创建Caddyfile文件，下面是参考配置</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">git.example.com &#123;</span><br><span class="line">    tls git@example.com     # 填写你的邮箱，用于申请证书</span><br><span class="line">    proxy / your-ip:10080</span><br><span class="line">    header / Strict-Transport-Security &quot;max-age=31536000;&quot;      # 开启HSTS</span><br><span class="line">    gzip</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h4 id="启动caddy"><a href="#启动caddy" class="headerlink" title="启动caddy"></a>启动caddy</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root]$ docker run -d --name=caddy -v ~/caddy/Caddyfile:/etc/Caddyfile -v ~/.caddy:/root/.caddy -p 80:80 -p 443:443 --restart=always abiosoft/caddy</span><br></pre></td></tr></table></figure>
<h3 id="配置git用户登录问题"><a href="#配置git用户登录问题" class="headerlink" title="配置git用户登录问题"></a>配置git用户登录问题</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">[root]$ mkdir -p /app/gogs/</span><br><span class="line">[root]$ cat &gt;/app/gogs/gogs &lt;&lt;<span class="string">'END'</span></span><br><span class="line"><span class="meta">#!/bin/sh</span></span><br><span class="line">ssh -p 10022 -o StrictHostKeyChecking=no git@127.0.0.1 \</span><br><span class="line"><span class="string">"SSH_ORIGINAL_COMMAND=\"<span class="variable">$SSH_ORIGINAL_COMMAND</span>\" <span class="variable">$0</span> <span class="variable">$@</span>"</span></span><br><span class="line">END</span><br><span class="line">[root]$ chmod 755 /app/gogs/gogs</span><br></pre></td></tr></table></figure>
<div class="note default"><p>这样就差不多完成了，下面需要在本地生成SSH密匙，然后在web端把密匙添加到Gogs<br>如果需要修改Gogs的配置，比如安装的时候DOMAIN写的IP现在要修改为域名，可以到/home/git/gogs/data/gogs/conf/找到app.ini，修改完后重启gogs容器</p></div>
<h3 id="参考文章"><a href="#参考文章" class="headerlink" title="参考文章"></a>参考文章</h3><p><a href="http://notes.guoliangwu.com/2018/01/09/Install-and-configure-Gogs-with-openSSH-Server/" target="_blank" rel="noopener">安装Gogs并共享主机22端口</a><br><a href="http://www.ateijelo.com/blog/2016/07/09/share-port-22-between-docker-gogs-ssh-and-local-system" target="_blank" rel="noopener">Share port 22 between Gogs inside Docker &amp; the local system</a></p>

      
    </div>

    
      

  <div class="popular-posts-header">相关文章</div>
  <ul class="popular-posts">
  
    <li class="popular-posts-item">
      
      
      <div class="popular-posts-title"><a href="/blog/post/deploy-flarumchina-with-docker/" rel="bookmark">使用Docker部署FlarumChina</a></div>
      
    </li>
  
  </ul>


    

    
    
    

    

    
       
    
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/blog/tags/Gogs/" rel="tag"># Gogs</a>
          
            <a href="/blog/tags/Git/" rel="tag"># Git</a>
          
            <a href="/blog/tags/SSH/" rel="tag"># SSH</a>
          
            <a href="/blog/tags/Docker/" rel="tag"># Docker</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/blog/post/hexo-next-optimize-leancloud/" rel="next" title="NexT主题优化：重构leancloud阅读量统计模块">
                <i class="fa fa-chevron-left"></i> NexT主题优化：重构leancloud阅读量统计模块
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>


  </div>


          </div>
          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="https://cdn-1256167913.image.myqcloud.com/images/avatar.png" alt="Raincal">
            
              <p class="site-author-name" itemprop="name">Raincal</p>
              <p class="site-description motion-element" itemprop="description">El Psy Congroo</p>
          </div>

          
            <nav class="site-state motion-element">
              
                <div class="site-state-item site-state-posts">
                
                  <a href="/blog/archives/">
                
                    <span class="site-state-item-count">9</span>
                    <span class="site-state-item-name">日志</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-categories">
                  
                    
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">3</span>
                    <span class="site-state-item-name">分类</span>
                  
                </div>
              

              
                
                
                <div class="site-state-item site-state-tags">
                  <a href="/blog/tags/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">17</span>
                    <span class="site-state-item-name">标签</span>
                  </a>
                </div>
              
            </nav>
          

          
            <div class="feed-link motion-element">
              <a href="/blog/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
              
                <span class="links-of-author-item">
                  
                  
                  
                    
                  
                  <a href="https://github.com/Raincal" title="GitHub &rarr; https://github.com/Raincal" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i></a>
                </span>
              
                <span class="links-of-author-item">
                  
                  
                  
                    
                  
                  <a href="https://twitter.com/cyj228" title="Twitter &rarr; https://twitter.com/cyj228" rel="noopener" target="_blank"><i class="fa fa-fw fa-twitter"></i></a>
                </span>
              
                <span class="links-of-author-item">
                  
                  
                  
                    
                  
                  <a href="https://weibo.com/cyj228" title="Weibo &rarr; https://weibo.com/cyj228" rel="noopener" target="_blank"><i class="fa fa-fw fa-weibo"></i></a>
                </span>
              
                <span class="links-of-author-item">
                  
                  
                  
                    
                  
                  <a href="https://t.me/Raincal" title="Telegram &rarr; https://t.me/Raincal" rel="noopener" target="_blank"><i class="fa fa-fw fa-telegram"></i></a>
                </span>
              
                <span class="links-of-author-item">
                  
                  
                  
                    
                  
                  <a href="mailto:cyj94228@gmail.com" title="E-Mail &rarr; mailto:cyj94228@gmail.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i></a>
                </span>
              
            </div>
          

          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                Links
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="https://blog.raincal.com" title="https://blog.raincal.com" rel="noopener" target="_blank">RAINCAL</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://status.raincal.com" title="https://status.raincal.com" rel="noopener" target="_blank">UPTIME</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.fangr.cc" title="https://www.fangr.cc" rel="noopener" target="_blank">Fong Ray's Blog</a>
                  </li>
                
              </ul>
            </div>
          

          
            
          
          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#创建git用户"><span class="nav-number">1.</span> <span class="nav-text">创建git用户</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装Gogs"><span class="nav-number">2.</span> <span class="nav-text">安装Gogs</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#生成SSH-key"><span class="nav-number">3.</span> <span class="nav-text">生成SSH key</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Caddy反向代理"><span class="nav-number">4.</span> <span class="nav-text">Caddy反向代理</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#启动caddy"><span class="nav-number">4.1.</span> <span class="nav-text">启动caddy</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置git用户登录问题"><span class="nav-number">5.</span> <span class="nav-text">配置git用户登录问题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#参考文章"><span class="nav-number">6.</span> <span class="nav-text">参考文章</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      
        <div class="back-to-top">
          <i class="fa fa-arrow-up"></i>
          
            <span id="scrollpercent"><span>0</span>%</span>
          
        </div>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2015 – <span itemprop="copyrightYear">2018</span>
  <span class="with-love" id="animate">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Raincal</span>

  

  
</div>


  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 – <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a></div>




        








        
      </div>
    </footer>

    

    
	
    

    
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>







  






  















  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/npm/jquery-lazyload@1.9.7/jquery.lazyload.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.ui.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.4.1/dist/jquery.fancybox.min.js"></script>
  


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=6.6.0"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=6.6.0"></script>



  
  


  <script type="text/javascript" src="/blog/js/src/affix.js?v=6.6.0"></script>

  <script type="text/javascript" src="/blog/js/src/schemes/pisces.js?v=6.6.0"></script>



  
  <script type="text/javascript" src="/blog/js/src/scrollspy.js?v=6.6.0"></script>
<script type="text/javascript" src="/blog/js/src/post-details.js?v=6.6.0"></script>



  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=6.6.0"></script>



  



  










  





  

  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  

  

  
  

  

  

  

  

  

  

</body>
</html>
